const INITIAL_STATE = {
  openid: null,
  nickName: '',
  avatarUrl: ''
}

export default function user(state = INITIAL_STATE, action) {
  switch (action.type) {
    case 'LOGIN':
      return {
        ...state,
        openid: action.payload.openid
      }
    default:
      return state
  }
}
